/*
 * @Author: 谢子健 1075010289@qq.com
 * @Date: 2024-09-17 21:20:53
 * @LastEditors: 谢子健 1075010289@qq.com
 * @LastEditTime: 2024-09-20 01:09:58
 * @FilePath: \ilink-vue-frontend\src\stores\CourseDetailStore.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { defineStore } from "pinia";

// Define the CourseInfo interface
interface CourseInfo {
  courseName: string;
  courseTag: string;
  courseDescription: string;
  viewNum: number;
  teacher?: any;
}

// Define the CourseDetailStore using Pinia
export const useCourseDetailStore = defineStore("courseDetail", {
  state: () => ({
    courseInfo: null as CourseInfo | null, // Initialize courseInfo as null
  }),
  actions: {
    setCourseInfo(courseInfo: CourseInfo) {
      this.courseInfo = courseInfo;
    },
  },
});
